package com.jekun.helloworld.mideng;

import org.apache.commons.collections4.map.LRUMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user5")
@RestController
public class UserController5 extends BaseController {

    @GetMapping("/add")
    public String addUser(String id) {
        // -------------- 幂等性调用（开始） --------------
        if (!IdempotentUtils.judge(id, this.getClass())) {
            return "执行失败";
        }
        // -------------- 幂等性调用（结束） --------------
        // 业务代码...
        userList.put(no, id);
        String s = "添加第 " + no + " 个用户,工号为:" + id;
        no++;
        return s;
    }
}